package demo5;

/**
 * @author 24岁没牵过女人的手
 * 日期：2023/9/6 14:30
 * 文件描述：
 */
public class TestEqual {
    public static void main(String[] args) {
        Stu xiawen = new Stu("xiawen", 12);
        Stu xiawen2 = new Stu("xiawen", 12);
        System.out.println(xiawen.hashCode());
        System.out.println(xiawen2.hashCode());
        System.out.println(xiawen == xiawen2);
        System.out.println(xiawen.equals(xiawen2));

        StringBuilder str = new StringBuilder("aljshdoal");
        str.append('c');
        System.out.println(str);

        StringBuffer str1 = new StringBuffer("sss");
        System.out.println(str1);
    }
}


class Stu{
    private String name;
    private Integer age;

    public Stu() {
    }

    public Stu(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Stu{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
    
}